<div class="actor" *ngIf="actor">
  <div class="position-relative me-3">
    <my-actor-avatar [actor]="actor" [actorType]="getActorType()" [previewImage]="preview" size="100"></my-actor-avatar>

    <div *ngIf="editable && !hasAvatar()" class="actor-img-edit-button button-focus-within" [ngbTooltip]="avatarFormat" placement="right" container="body">
      <my-global-icon iconName="upload"></my-global-icon>
      <label class="visually-hidden" for="avatarfile" i18n>Upload a new avatar</label>
      <input #avatarfileInput type="file" name="avatarfile" id="avatarfile" [accept]="avatarExtensions" (change)="onAvatarChange(avatarfileInput)"/>
    </div>

    <div *ngIf="editable && hasAvatar()" ngbDropdown placement="right">
      <button type="button" class="actor-img-edit-button" ngbDropdownToggle>
        <my-global-icon iconName="edit"></my-global-icon>
        <label class="visually-hidden" for="avatarMenu" i18n>Change your avatar</label>
      </button>

      <div ngbDropdownMenu>
        <div class="dropdown-item dropdown-file button-focus-within" [ngbTooltip]="avatarFormat">
          <my-global-icon iconName="upload"></my-global-icon>
          <span for="avatarfile" i18n>Upload a new avatar</span>
          <input #avatarfileInput type="file" name="avatarfile" id="avatarfile" [accept]="avatarExtensions" (change)="onAvatarChange(avatarfileInput)"/>
        </div>

        <button type="button" class="dropdown-item" (click)="deleteAvatar()" (key.enter)="deleteAvatar()">
          <my-global-icon iconName="delete"></my-global-icon>
          <span i18n>Remove avatar</span>
        </button>
      </div>

    </div>
  </div>

  <div class="actor-info">
    <div class="actor-info-display-name">{{ actor.displayName }}</div>
    <div *ngIf="displayUsername" class="actor-info-username">{{ actor.name }}</div>
    <div *ngIf="displaySubscribers" i18n class="actor-info-followers">{{ actor.followersCount }} subscribers</div>
  </div>
</div>
